 |
 GetDocumentByKey with Key String Array ~Paul Bubresazenflar 01/23/2004 04:56 PM Applications Development All Releases All Platforms
I'm trying to use the GetDocumentByKey method with a string array, but it always returns Nothing. All the columns in the view are sorted. Here's the code: PLZ HELP!
Dim Session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim doc As NotesDocument
Dim item As NotesItem
Dim var As String
Dim key As String
Dim ctr As Integer
Set db = session.CurrentDatabase
Set View = db.GetView("MYVIEW")
Set qry.Connection = con
Set result.Query = qry
If con.ConnectTo("ODBCsource", "USER", "pass") Then
qry.SQL = "SELECT * FROM THETABLE"
result.Execute
Else
Messagebox "Connection to the OBDC Data Source Failed!" ,0,"Error"
Exit Sub
End If
Do
result.NextRow
key = ""
For i = 1 To result.NumColumns
var = result.GetValue(i)
key = key & var
Next
Set doc = view.GetDocumentByKey(key)
If doc Is Nothing Then
*** At this point debug shows the next line is processed, meaning the getdocumentbykey method returned Nothing, when the document does exist!!
Am I defining the key wrong?!?
Go back |